import { HttpClient } from "../../../../service/Http/HttpClient";
const baseUrl = "/api";

/**数据管理模块开始 */
//所属项目采集方案分页查询
export const getCollectionMethodList = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/getAmiByPeId", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//新增采集方案
export const addCollectionMethod = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/add", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除采集方案
export const deleteCollectionMethod = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/delete", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//修改采集方案
export const updateCollectionMethod = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/update", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//获取规约协议集合
export const getProtocalType = () => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/getProtocalType", {
    method: "POST",
    headers: {},
  });
};
//更新采集方案状态（是否启用状态）
export const enableAmi = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/enableAmi", {
    method: "POST",
    headers: {},
    body: pream,
  });
};

//采集方案已绑定的设备分页查询
export const getBoundDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/getBoundDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//采集方案未绑定的设备分页查询
export const getUnBoundDevices = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/getUnBoundDevices", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//采集方案绑定/解绑设备
export const configDevice = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/configDevice", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//采集方案的配置明细分页查询
export const getConfigDetailByAmiId = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/getConfigDetailByAmiId", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//规约协议的命令查询
export const getProtocalCmd = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/getProtocalCmd", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//新增命令
export const addConfigDetail = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/addConfigDetail", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//编辑命令
export const updateConfigDetail = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/updateConfigDetail", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
//删除命令
export const deleteConfigDetail = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/amischeme/deleteConfigDetail", {
    method: "POST",
    headers: {},
    body: pream,
  });
};

/**数据管理模块结束 */
/**能源库存管理 开始*/
//能源库存查询
export const getEnergyAmount = () => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/energy/inventory/getEnergyAmount", {
    method: "POST",
    headers: {},
  });
};
//能源账户明细查询
export const getEnergyAccountDetail = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(
    baseUrl + "/ems/datamgr/energy/inventory/getEnergyAccountDetail",
    {
      method: "POST",
      headers: {},
      body: pream,
    }
  );
};
//能源入库
export const energyStore = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/energy/inventory/energyStore", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
/**能源库存管理 结束*/
//设备用量详情
export const getDeviceListData = (pream: string) => {
  const http = HttpClient.instance();
  return http.fetch(baseUrl + "/ems/datamgr/usedenergyqry/getDeviceListData", {
    method: "POST",
    headers: {},
    body: pream,
  });
};
///ems/datamgr/usedenergyqry/getDeviceListData
